//
//  WUserLikeView.m
//  NNing
//
//  Created by ym on 16/8/11.
//  Copyright © 2016年 ym. All rights reserved.
//

#import "UserLikeView.h"

@interface UserLikeView ()

{
    
}
@end

@implementation UserLikeView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self creatUI];
    }
    return self;
}

- (void)creatUI{
    UIButton *share = [UIButton buttonWithType:0];
    [self addSubview:share];
    [share setBackgroundImage:[UIImage imageNamed:@"tabBar_publish_icon"] forState:0];
    share.sd_layout.leftEqualToView(self).topSpaceToView(self,1).widthIs(30).heightIs(30);
    
    UIButton *twice = [UIButton buttonWithType:0];
    [self addSubview:twice];
    [twice setBackgroundImage:[UIImage imageNamed:@"tabBar_publish_icon"] forState:0];
    twice.sd_layout.leftSpaceToView(share,10).topSpaceToView(self,1).widthIs(30).heightIs(30);
 //   [self setupAutoWidthFlowItems:arr withPerRowItemsCount:5 verticalMargin:0 horizontalMargin:5 verticalEdgeInset:1 horizontalEdgeInset:1];
    
    
}
- (void)layoutSubviews{
    [super layoutSubviews];
    
    NSMutableArray *arr = [NSMutableArray array];
    for (NSInteger i = 0; i < _imageArr.count; i++) {
        UIImageView *a = [[UIImageView alloc] init];
        a.image =[UIImage imageNamed: _imageArr[i]];
        [arr addObject:a];
        [self addSubview:a];
        a.frame = CGRectMake(80 + 40 * i, 1, 30 , 30);
        if (150+40*(i + 1) > Screen_Width) {
            a.hidden = YES;
        }
        
    }

}


@end
